package net.bwie.jtp.jtprealtimeservice.mapper;

import net.bwie.jtp.jtprealtimeservice.bean.TrafficSessionReport;
import net.bwie.jtp.jtprealtimeservice.bean.TrafficUvReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TrafficMapper {


    @Select("select \n" +
            "    channel,\n" +
            "    sum(uv_count) AS uv_count\n" +
            "from jtp_log_report.dws_log_page_view_window_report\n" +
            "where toDate(window_start_time) = #{date}\n" +
            "group by channel")
    List<TrafficUvReport> getUvCount(@Param("date")String date);



    //每个省份的会话数量 （会话量）
    @Select("select \n" +
            "    province,\n" +
            "    sum(session_count) AS session_count\n" +
            "from jtp_log_report.dws_log_page_view_window_report\n" +
            "where toDate(window_start_time) = #{date}\n" +
            "group by province")
    List<TrafficSessionReport> getSessionCount(@Param("date")String date);
}
